package com.mxpio.erp.common.mes.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.technology.entity.ProcessInfo;
import com.mxpio.erp.common.technology.entity.WorkCenter;
import com.mxpio.erp.common.technology.entity.WorkShop;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;


@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_MES_WORKORDER")
@Schema(description="生产订单-工单表")
public class ManufactureWorkOrder extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**批次条码*/
	@Id
	@Schema(description = "工单号/批次号")
	@Column(name = "BATCH_CODE_" )
	private String batchCode;

	/**批次序号*/
	@Schema(description = "批次序号")
	@Column(name = "BATCH_ORDER_" )
	private Integer batchOrder;

	@Dict(dicCode = "mes_order_status")
	@Column(name = "BATCH_STATUS_" )
	@Schema(description = "批次状态")
	private String batchStatus;
	/**批次数量*/
	@Schema(description = "批次数量")
	@Column(name = "BATCH_NUM_" )
	private Integer batchNum;
	/**打印次数*/
	@Schema(description = "打印次数")
	@Column(name = "PRINT_NUM_" )
	private Integer printNum;

	/**批次完成数量*/
	@Schema(description = "批次完成数量")
	@Column(name = "BATCH_COMP_NUM_" )
	private Integer batchCompNum;
	/**批次报废数量*/
	@Schema(description = "批次报废数量")
	@Column(name = "BATCH_SCRAP_NUM_" )
	private Integer batchScrapNum;

	/**订单主键*/
	@Column(name = "BIZ_NO_", updatable = false)
	@Schema(description = "生产订单单号")
	private String bizNo;

	/**批次预留字段*/
	@Dict(dicCode = "mes_batch_type")
	@Column(name = "BATCH_TYPE_" )
	@Schema(description = "批次类型")
	private String batchType;

	/*@Schema(description = "sn号")
	@Column(name = "SN_ID_" )
	private String snId;*/

	/**批次暂停恢复状态*/
	@Schema(description = "批次暂停恢复状态")
	@Column(name = "BATCH_STOP_RECOVERY_" )
	private String batchStopRecovery;
	/**批次预留字段*/
	@Schema(description = "批次预留字段")
	@Column(name = "CUR_PROC_ORDER_" )
	private Integer curProcOrder;
	/**批次状态*/
	@Dict(dicCode = "mes_order_status")
	@Column(name = "PRE_BATCH_STATUS_" )
	@Schema(description = "批次暂停前状态")
	private String preBatchStatus;

	/**转线标志：0-未转线，1-转线*/
	@Column(name = "CHANGE_FLAG_" )
	@Schema(description = "转线标志")
	private String changeFlag;

	@Column(name = "MAIN_WORKSHOP_")
	@Schema(description = "主制车间")
	@Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
	private String mainWorkshop;

	@Column(name = "WORK_CENTER_CODE_")
	@Schema(description = "工作中心")
	@Dict(dicCode = "workCenterCode",dicEntity = WorkCenter.class,dicText = "workCenterName")
	private String workCenterCode;

	@Schema(description = "批次来源")
	@Column(name = "BATCH_FROM_" )
	@Dict(dicCode = "mes_batch_from")
	private String batchFrom;

	@Schema(description = "父批次编码")
	@Column(name = "PARENT_BATCH_CODE_" )
	private String parentBatchCode;

	@Schema(description = "原始批次数量-")
	@Column(name = "ORIGIN_BATCH_NUM_" )
	private Integer originBatchNum;

	@Dict(dicCode = "ERP_COMMON_YESNO")
	@Column(name = "FIRST_INSPECT_NEEDED")
	@Schema(description = "是否首检")
	private String firstInspectNeeded;

	// 首检类型
	@Column(name = "FIRST_INSPECT_TYPE")
	@Dict(dicCode = "ERP_MES_PROD_INSP_TYPE")
	@Schema(description = "首检类型")
	private String firstInspectType;

	// 首检数量
	@Column(name = "FIRST_INSPECT_NUM")
	@Schema(description = "首检数量")
	private Integer firstInspectNum;

	// 是否尾检
	@Column(name = "FINAL_INSPECT_NEEDED")
	@Schema(description = "是否尾检")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String finalInspectNeeded;

	// 尾检类型
	@Column(name = "FINAL_INSPECT_TYPE")
	@Dict(dicCode = "mes_check_type")
	@Schema(description = "尾检类型")
	private String finalInspectType;

	// 尾检数量
	@Column(name = "FINAL_INSPECT_NUM")
	@Schema(description = "尾检数量")
	private Integer finalInspectNum;

}
